package com.leesche.netdoll.communication.protocol.encoder;

import org.apache.commons.lang3.math.NumberUtils;

public class IntegerByteEncoder implements Encoder {

	@Override
	public byte[] encode(Object value) {
		value = value == null ? 0 : value;

		return new byte[] { (byte) ((NumberUtils.createDouble(value.toString()).intValue()) & 0xff) };
	}
}
